home *** CD-ROM | disk | FTP | other *** search
/ NeXT Enterprise Objects Framework 1.1 / NeXT Enterprise Objects Framework 1.1.iso / NextDeveloper / Headers / eointerface / EOAssociation.h < prev    next >
Encoding:
Text File  |  1994-08-19  |  2.6 KB  |  84 lines

  1. // EOAssociation.h
  2. // Enterprise Objects Framework
  3. // Copyright (c) 1993, NeXT Computer, Inc.  All rights reserved.
  4.  
  5. #import    <foundation/NSDictionary.h>
  6.  
  7. #import    "EOController.h"
  8.  
  9. #import <appkit/appkit.h>
  10.  
  11.  
  12. // These methods should be moved to the Appkit at some point. They allow
  13. // Control objects to accept and return NSString values.
  14.  
  15. @interface Control (NSStringSupport)
  16. - (NSString *)string;
  17. - (void)setString: (NSString *)aString;
  18. @end
  19.  
  20.  
  21. // These methods should be moved to the Appkit at some point. They allow
  22. // ActionCell objects to accept and return NSString values.
  23.  
  24. @interface ActionCell (NSStringSupport)
  25. - (NSString *)string;
  26. - (void)setString: (NSString *)aString;
  27. @end
  28.  
  29.  
  30. // An EOAssociation acts as the glue between user interface widgets and
  31. // properties of data-bearing objects.  EOAssociations are held by
  32. // EOControllers.  EOControllers may have many EOAssociations.
  33. // EOControllers manage activity between whatever provides allocation
  34. // and storage of the actual data-bearing objects (for example, an
  35. // EODatabaseDataSource), and the user interface through its
  36. // EOAssociations.  An EOAssociation accomplishes its work by
  37. // intercepting action and delegation methods of a particular UI
  38. // widget--usually a subclass of Control.  It can set values, get values, and
  39. // monitor selection.
  40. //
  41. // The EOAssociationNotification protocol is declared in EOController.h.
  42.  
  43.  
  44. @interface EOAssociation: NSObject <EOAssociationNotification>
  45. {
  46.     id destination; // Either a widget or an EOController
  47.     EOController *controller;
  48.     NSString *key;
  49. }
  50.  
  51. - initWithController:(EOController *)controller 
  52.     key:(NSString *)key
  53.     destination:destination;
  54.     // Initializes a newly allocated EOAssociation with controller. key is
  55.     // used as the identifier for value transfers to and from destination
  56.     // (a UI widget or another EOController).
  57.  
  58. - (EOController *)controller;
  59.     // Returns the controller responsible for the association.
  60.  
  61. - destination;
  62.     // Returns the association's destination object.
  63.  
  64. - (NSString *)key;
  65.     // Returns the key used as the identifier that the association transfers
  66.     // to and from its destination.
  67.  
  68. - value;
  69.     // Returns the value of the association's destination.  This is used by
  70.     // the controller to set up the dictionary that will be passed to the
  71.     // currently selected object.
  72.  
  73. @end
  74.  
  75. // EOAssociationClasses is implemented as a category on widgets to
  76. // determine if they are capable of displaying multiple items.
  77.  
  78. @interface Object (EOAssociationClasses)
  79. - (Class)associationClass;
  80.     // Widget classes should implement this method.  It returns the subclass of
  81.     // EOAssociation used by the widget.
  82.  
  83. @end
  84.